package com.hubing.controller;

import com.hubing.bean.Cat;
import com.hubing.bean.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @Autowired
    Cat cat;
    @Autowired
    Person person;

    @RequestMapping("/cat")
    public Cat cat(){
        return cat;
    }
    @RequestMapping("/hello")
    public String Helloworld(@RequestParam("name") String name){
        return "Hello World! spring boot2你好"+name;
    }
    @RequestMapping("/person")
    public Person getperson(){
        return person;
    }
    @Override
    public String toString() {
        return "HelloController{" +
                "cat=" + cat +
                '}';
    }
}
